package org.NooLab.itexx.retrieval;

import java.io.Serializable;
import java.util.ArrayList;



public class DeliveryPackage implements DeliveryPackageIntf, Serializable{

	ArrayList<String> queryTerms;
	private String guid;
	boolean deliveryDigested = false;
	private String groupGuid;
	
	/** the higher the earlier;
	 *  we use this to get some of the requests delayed.
	 *  Packages are implicitly sorted along the priority
	 */
	int priority = 7;
	
	/** this describes the degree of customization of a query as compared
	 *  to the raw input.
	 */
	int customGrade = 1;
	
	int queryContext = DeliveryPackageIntf._DP_QUERYCONTEXT_SIMPLEWORD ; // = 1 
	
	ArrayList<Integer> queryContexts = new ArrayList<Integer>() ;
	
	// ----------------------------------------------------
	public DeliveryPackage(){
		
		init();
	}
	public DeliveryPackage(DeliveryPackage indp) {
		
		init();
		
		queryTerms = new ArrayList<String> (indp.queryTerms) ;
		
		guid = indp.guid ;
		deliveryDigested = indp.deliveryDigested ;
		groupGuid = indp.groupGuid ;
		
		priority = indp.priority ;
		
		customGrade = indp.customGrade ;
		
	}

	// ----------------------------------------------------
	
	

	private void init() {
		queryContexts.add(_DP_QUERYCONTEXT_SIMPLEWORD);
		queryContexts.add(_DP_QUERYCONTEXT_SOMEWORDS);
		queryContexts.add(_DP_QUERYCONTEXT_SENTENCE);
		queryContexts.add(_DP_QUERYCONTEXT_SECTION);
		queryContexts.add(_DP_QUERYCONTEXT_SECTIONLARGE);
		queryContexts.add(_DP_QUERYCONTEXT_DOC);
		queryContexts.add(_DP_QUERYCONTEXT_DOCLARGE);
		
	}


	public void setGuid(String guid) {
		// 
		this.guid = guid;
	}

	public void setQueryTerms(ArrayList<String> queryTerms) {
		this.queryTerms = queryTerms;
	}


	public ArrayList<String> getQueryTerms() {
		return queryTerms;
	}


	public String getGuid() {
		return guid;
	}


	public boolean isDeliveryDigested() {
		return deliveryDigested;
	}


	public void setDeliveryDigested(boolean deliveryDigested) {
		this.deliveryDigested = deliveryDigested;
	}


	public void setGroupGuid(String guidstr) {
		groupGuid = guidstr;
	}
	public String getGroupGuid() {
		return groupGuid ;
	}

	
}
